package com.itcncp.wechat.app.dao.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.itcncp.common.plugin.ToStringSerializer;

import java.io.Serializable;
import java.util.Date;

public class UserBankInfo implements Serializable {
    /**
     * 用户ID
     *
     * @mbg.generated
     */
    @JSONField(serializeUsing= ToStringSerializer.class)
    private Long userId;

    /**
     * 银行卡号
     *
     * @mbg.generated
     */
    private String bankcardNo;

    /**
     * 开户银行编号
     *
     * @mbg.generated
     */
    private String bankId;

    /**
     * 所属银行名
     *
     * @mbg.generated
     */
    private String bankName;

    /**
     * 银行卡类型, 1-借记卡, 2-贷记卡, 3-准贷记卡, 4-预付费卡 
 5-其他
     *
     * @mbg.generated
     */
    private Byte bankcardType;

    /**
     * 绑卡时间
     *
     * @mbg.generated
     */
    private Date createTime;

    /**
     * 银行卡状态 1、卡正常 2、卡异常 3、卡注销
     *
     * @mbg.generated
     */
    private Byte bankcardState;

    /**
     * 修改时间
     *
     * @mbg.generated
     */
    private Date updateTime;

    /**
     * 备注
     *
     * @mbg.generated
     */
    private String remark;

    private static final long serialVersionUID = 1L;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getBankcardNo() {
        return bankcardNo;
    }

    public void setBankcardNo(String bankcardNo) {
        this.bankcardNo = bankcardNo;
    }

    public String getBankId() {
        return bankId;
    }

    public void setBankId(String bankId) {
        this.bankId = bankId;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public Byte getBankcardType() {
        return bankcardType;
    }

    public void setBankcardType(Byte bankcardType) {
        this.bankcardType = bankcardType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Byte getBankcardState() {
        return bankcardState;
    }

    public void setBankcardState(Byte bankcardState) {
        this.bankcardState = bankcardState;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", bankcardNo=").append(bankcardNo);
        sb.append(", bankId=").append(bankId);
        sb.append(", bankName=").append(bankName);
        sb.append(", bankcardType=").append(bankcardType);
        sb.append(", createTime=").append(createTime);
        sb.append(", bankcardState=").append(bankcardState);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserBankInfo other = (UserBankInfo) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getBankcardNo() == null ? other.getBankcardNo() == null : this.getBankcardNo().equals(other.getBankcardNo()))
            && (this.getBankId() == null ? other.getBankId() == null : this.getBankId().equals(other.getBankId()))
            && (this.getBankName() == null ? other.getBankName() == null : this.getBankName().equals(other.getBankName()))
            && (this.getBankcardType() == null ? other.getBankcardType() == null : this.getBankcardType().equals(other.getBankcardType()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getBankcardState() == null ? other.getBankcardState() == null : this.getBankcardState().equals(other.getBankcardState()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getBankcardNo() == null) ? 0 : getBankcardNo().hashCode());
        result = prime * result + ((getBankId() == null) ? 0 : getBankId().hashCode());
        result = prime * result + ((getBankName() == null) ? 0 : getBankName().hashCode());
        result = prime * result + ((getBankcardType() == null) ? 0 : getBankcardType().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getBankcardState() == null) ? 0 : getBankcardState().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }
}